<template>
  <div>
    <div class="box">
      <div class="tit">
        <h3>{{ sellerInfo.name }}</h3>
        <p class="scop">
          <span>
            <van-rate
              size="14px"
              readonly
              allow-half
              color="#f8d41e"
              v-model="sellerInfo.score"
            />
            (666) 月售999单</span
          >
          <span>已收藏</span>
        </p>
      </div>
      <div class="price">
        <Card v-for="(item, i) in price" :key="i" :price="item.name" />
      </div>
      <div class="note">
        <h4>公告与活动</h4>
        <p>{{ sellerInfo.bulletin }}</p>
      </div>
      <ul>
        <li v-for="(item, i) in sellerInfo.supports" :key="i">
          <span>惠</span>{{ item }}
        </li>
      </ul>
      <h4 class="imgstit">商家实景</h4>
      <div ref="box" class="imgs">
        <div :style="{ width: 220 * sellerInfo.pics.length + 'px' }">
          <img
            v-for="(item, i) in sellerInfo.pics"
            :key="i"
            :src="item"
            alt="123"
          />
        </div>
      </div>
      <h4>商家信息</h4>
      <p>该商家</p>
      <p></p>
      <p></p>
      <p></p>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data() {
    return {
      value: 3,
      shop: {},
      price: []
    }
  },
  computed: {
    ...mapState(['sellerInfo']),
    nnum() {
      return this.$store.state.num
    }
  },
  methods: {
    vuexadd() {
      console.log(12)
      this.$store.commit('ADDNUM', 1)
    }
  },
  created() {
    this.price.push({ name: this.sellerInfo.minPrice, tit: '起送价' })
    this.price.push({ name: this.sellerInfo.deliveryPrice, tit: '商家配送' })
    this.price.push({ name: this.sellerInfo.deliveryTime, tit: '平均配送时间' })
  },
  mounted() {}
}
</script>

<style lang="less" scoped>
.box {
  width: 90%;
  margin: 0 auto;
  .tit {
    line-height: 35px;
  }
  .scop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #cecece;
    span {
      font-size: 12px;
      color: #9e9e9e;
    }
  }
  .price {
    display: flex;
  }
  .note {
    margin-top: 30px;
    margin-bottom: 10px;
    p {
      word-wrap: break-word;
      width: 90%;
      margin: 0 auto;
      color: #ed3e1d;
      line-height: 30px;
      margin-top: 10px;
    }
  }
  ul {
    margin-top: 20px;
    li {
      display: flex;
      align-items: center;
      height: 40px;
      span {
        background-color: #000;
        margin-right: 5px;
        font-size: 12px;
        color: #fff;
        padding: 2px;
      }
    }
  }
  .imgstit {
    margin-top: 40px;
  }
  .imgs {
    margin-top: 5px;
    overflow-x: scroll;
    div {
      display: flex;
    }
    img {
      width: 200px;
      height: 200px;
      margin-right: 20px;
    }
  }
}
</style>
